<template>
    <div class="app-container">
        <uc-table url="admin/log/getLogPage" name="操作日志" ref="logTable" pageable table-border :search-form="searchForm">
            <template slot="searchForm">
                <el-form size="mini" :inline="true" :model="searchForm" class="demo-form-inline filter-container">
                    <!--搜索输入框-->
<!--                    <el-form-item>-->
<!--                        <el-select v-model="searchForm.action" placeholder="请选择操作动作" style="width: 100%" clearable  @clear="clearInput()">-->
<!--                            <el-option value="create" label="create"></el-option>-->
<!--                            <el-option value="update" label="update"></el-option>-->
<!--                            <el-option value="delete" label="delete"></el-option>-->
<!--                            <el-option value="getInfo" label="getInfo"></el-option>-->
<!--                            <el-option value="getList" label="getList"></el-option>-->
<!--                            <el-option value="getPage" label="getPage"></el-option>-->
<!--                        </el-select>-->
<!--                    </el-form-item>-->
                    <!--搜索按钮--新增按钮-->
<!--                    <el-form-item>-->
<!--                        <el-button type="primary" icon="el-icon-search" class="filter-item" @click="handleSearch()">查询</el-button>-->
<!--                    </el-form-item>-->
                </el-form>
            </template>
            <template slot="columns">
                <el-table-column prop="userName" label="操作人" align="left" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="userType" label="用户类型" align="left" :show-overflow-tooltip="true">
                    <template slot-scope="scope">
                        {{scope.row.userType==0?"管理员":"用户"}}
                    </template>
                </el-table-column>
                <el-table-column prop="action" label="动作" align="left" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="obj" label="操作对象" align="left" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="logTime" label="记录时间" align="left" :show-overflow-tooltip="true">
                    <template slot-scope="scope">
                        {{scope.row.logTime | dateFormat}}
                    </template>
                </el-table-column>
                <el-table-column prop="address" label="操作" width="120" align="left" class-name="small-padding fixed-width">
                    <template slot-scope="scope">
                        <el-button size="mini" icon="el-icon-info" type="success" @click="handleInfo(scope.row)">详情</el-button>
<!--                        <el-button size="mini" type="danger" icon="el-icon-delete" :loading="deleteLoading" @click="handleDelete(scope.row)">删除</el-button>-->
                    </template>
                </el-table-column>
            </template>
        </uc-table>
    </div>
</template>

<script>
import UcTable from "@/components/UcTable/index.vue";
export default {
    name: "enterpriseList",
    components: {UcTable},
    data(){
        return{
            searchForm:{


            },
            deleteLoading:false,
        }
    },
    created() {

    },
    methods:{
        handleSearch(){
            this.$refs.logTable.getTableData(1)
        },
        handleInfo(val){
            this.$router.push("/sys/log/info?ucId="+val.ucId)
        },
        clearInput(){
            //清除输入框
            this.searchForm.name = null
            this.handleSearch()
        }
    }
}
</script>

